users = ["张三", "李四"]
passwords = ["123", "124"]
count1 = 1
i = 0
while count1 <= 3:
    user = input("请输入用户名：")
    if user in users:
        num = users.index(user)
        count = 1
        while count <= 3:
            password = input("请输入密码:")
            if password == passwords[num]:
                print("登录成功！")
                i = 1
                break
            else:
                print("密码错误！")
            count += 1
        if count > 3:
            break
        if i ==1:
            break
    else:
        print("用户名不存在！")
    count1 += 1
